using SalesPoint.Model;
using Xtensive.Orm;
using Xtensive.Orm.Model;
using Xtensive.Orm.Security;

namespace SalesPoint.Security
{
  [HierarchyRoot(InheritanceSchema = InheritanceSchema.SingleTable)]
  public abstract class EmployeeRole : Role
  {
    [Field, Key]
    public int Id { get; set; }

    protected override void RegisterPermissions()
    {
      // This is base role for every employee

      // All employees can see products
      RegisterPermission(new Permission<Product>());
      // All employees can see employees
      RegisterPermission(new Permission<Employee>());
    }

    protected EmployeeRole(Session session)
      : base(session)
    {
    }
  }
}
